<HTML><HEAD><TITLE>+Constraint r_conflict_prop ?ConflictSet</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(repair)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>+Constraint r_conflict_prop ?ConflictSet</H1>
Annotate Constraint as a repair constraint and monitor it for conflicts. It is propagated when it goes into conflict.
<DL>
<DT><EM>Constraint</EM></DT>
<DD>Constraint to be monitored for conflict (Goal)
</DD>
<DT><EM>ConflictSet</EM></DT>
<DD>Handle for the conflict set (atom or varibale)
                argument can alternatively be ConflictSet-ConflictData
</DD>
</DL>
<H2>Description</H2>
<P>
Repair constraints are constraints that are monitored by the repair library 
for conflicts caused by the tentative values of variables in the constraints. 
r_conflict_prop/2 annotates a constraint to be a repair constraint, and 
as with r_conflict/2, monitors the constraint for conflicts. The difference
is that when a violation is first detected and the Constraint enters the 
ConflictSet, it is actually propagated at that point by calling the constraint.

</P><P>
Note that if you want constraint propagation from the very beginning,
you should simply write the constraint twice, once without and once
with annotation.

</P><P>
Constraint can be any goal that works logically, it should be useable
as a ground check, and work on any instantiation pattern. Typically,
it will be a constraint from some solver library.

</P><P>
ConflictSet can be a user-defined name (an atom) or it can be
a variable in which case the system returns a conflict set handle that can
later be passed to conflict_constraints/2. 

</P><P>
Note that using different conflict sets for different groups of constraints
will often make the search algorithm easier and more efficient.
A second allowed form of the r_conflict annotation is
Constraint r_conflict ConflictSet-ConflictData.
If this is used, f ConflictData will appear in the conflict
set instead of the Constraint itself.
This feature can be used to pass additional information to the
search algorithm.
</P>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Resatisfiable</H3>
no
<H2>Examples</H2>
<PRE> A #= B r_conflict_prop c, A = 5, writeln(1), B = 11, write(2), conflict_constraints(c, X).

1

no (more) solution.
% fails because A #= B was propagated when a conflict was detected 
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/repair/conflict_constraints-2.html">conflict_constraints / 2</A>, <A HREF="../../lib/repair/r_conflict-2.html">r_conflict / 2</A>
</BODY></HTML>
